package com.xuecheng.order.task;

import com.xuecheng.order.config.RabbitMQConfig;
import com.xuecheng.order.service.XcTaskService;
import org.springframework.amqp.rabbit.annotation.RabbitListener;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

@Component
public class ChooseCourseTaskCallBack {
    @Autowired
    XcTaskService xcTaskService;
    /**
     * @Description: 消息对列，接受消息
     * @Param:
     * @return:
     * @Author: Mr.Yuan
     * @Date:
     */
    @RabbitListener(queues = RabbitMQConfig.XC_LEARNING_FINISHADDCHOOSECOURSE)
    public  void listenerAddFishedCourse(String taskId){
//            添加历史记录，删除原先任务
        xcTaskService.saveAndDelete(taskId);
    }
}
